const Websocket = require("ws");
const server = new Websocket.Server({ port: 3232 });
console.log('%cindex.js line:3 server', 'color: #007acc;', server);


server.on("open",function open(){
    console.log('%cindex.js line:7 "open"', 'color: #007acc;', "open");
})
server.on("connection", (socket) => {

    // setTimeout(() => {
    //     socket.send("Hello from server!");
    //   }, 1000);

      setInterval(() => {
        socket.send("Hello from server!");
      }, 100);
    console.log('%cindex.js line:10 "监控着"', 'color: #007acc;', "监控着");
    // console.log('%cindex.js line:10 socket', 'color: #007acc;', socket)
})
